package com.lancoo.znbkxx.teacher.model.data

import android.os.Parcelable
import com.chad.library.adapter.base.entity.IExpandable
import com.chad.library.adapter.base.entity.MultiItemEntity
import com.lancoo.znbkxx.teacher.model.AnswerArea
import com.lancoo.znbkxx.teacher.model.AnswerInfo
import com.lancoo.znbkxx.teacher.model.TextInfo
import kotlinx.android.parcel.Parcelize

/**
 * @author : wealive
 * @date   : 2020/9/22 14:37
 * @desc   :
 */
data class HardItemSolution(
    val AudioPath: String,
    val ClassicalList: MutableList<Classical>,
    val Duration: String,
    val EvalState: Int,
    val FailedCount: Int,
    val ImagePath: String,
    val PassedCount: Int,
    val QuesID: String,
    val ReadCount: Int,
    val ScoreRate: Double,
    val SolutionContent: String,
    val State: Int,
    val StuAllCount: Int,
    val TkModel: TkModel,
    val VideoPath: String,
    val WrongStuCount: Int,
    val ZSDList: MutableList<ImportKlg>
)

data class TkModel(
    var IsSelected: Boolean,
    val ChildList: MutableList<Child>,
    val DVAL: String,
    val EXVAL: String,
    val EvalType: Int,
    val GenreID: Int,
    val GenreName: String,
    val GenreType: String,
    val HVAL: String,
    val ImportKlgList: ArrayList<ImportKlg>,
    val IsOral: Boolean,
    val MainKlgList: MutableList<MainKlg>,
    val ModelAnswerAreaList: MutableList<AnswerArea>,
    val ModelAnswerInfoList: MutableList<AnswerInfo>,
    val ModelTextInfoList: MutableList<TextInfo>,
    val QuesAudio: QuesAudio,
    val QuesBody: String,
    val QuesBrief: String,
    val QuesChildNum: Int,
    val QuesID: String,
    val QuesLeaderContent: String,
    val Resource: String,
    val SortNum: Int,
    val SpecialFeatureCodes: String,
    val Theme: String,
    val TotalItemCount: Int,
    val TypeName: String,
    val TypeNo: String
)

@Parcelize
data class Child(
    val AudioPath: String,
    val ChildAnalysis: String,
    val ChildAnswer: String,
    val ChildAnswerType: Int,
    val ChildAsk: String,
    val ChildAudio: ChildAudio,
    val ChildDisplay: String,
    val ChildIndex: Int,
    val ChildOptionList: MutableList<ChildOption>,
    val ChildSectionName: String,
    val EvalScore: Double,
    val ImagePath: String,
    val ItemList: MutableList<Item>,
    val ScoreRate: Double,
    val SortIndexType: Int,
    val State: Int,
    val StuAnswer: String,
    val TotalScore: Double,
    val WrittingAnswerType: Int
) : Parcelable

@Parcelize
data class ImportKlg(
    var IsSelect: Int,
    val Code: String,
    val Name: String,
    val UniqueCode: String
) : Parcelable

data class MainKlg(
    val Code: String,
    val Name: String,
    val UniqueCode: String
)

data class QuesAudio(
    val Article: String,
    val Path: String,
    val TimeLength: Int
)

@Parcelize
data class ChildAudio(
    val Path: String,
    val TimeLength: Int
) : Parcelable

@Parcelize
data class ChildOption(
    var Index: Int,
    var isAnswer: Boolean,
    val Option: String,
    val OptionIndex: String,
    var parentIndex: Int,
    var parentSize: Int,
    val Rate: String,
    val ShowType:Int,
    var size: Int,
    val StuCount: String
) : MultiItemEntity, Parcelable {
    override fun getItemType(): Int {
        return 1
    }
}

@Parcelize
data class Item(
    val AudioPath: String,
    val EvalScore: Double,
    val ImagePath: String,
    val IsRemark: Boolean,
    val ItemAnalysis: String,
    val ItemAnswer: String,
    val ItemAskList: MutableList<StuAnswer>,
    val ItemIndex: Int,
    var ItemOptionList: MutableList<ChildOption>,
    val ItemSortIndex: String,
    var mExpanded: Boolean = false,
    var Rate: String,
    val ScoreRate: Double,
    var Size: Int,
    val SortIndex: Int,
    val State: Int,
    val StuAnswer: String,
    var StuCount: String,
    val TotalScore: Double,
    val WrittingAnswerType: Int
) : IExpandable<ChildOption>, MultiItemEntity, Parcelable {
    override fun getLevel(): Int {
        return 0
    }

    override fun getItemType(): Int {
        return 0
    }

    override fun getSubItems(): MutableList<ChildOption> {
        return ItemOptionList
    }

    override fun isExpanded(): Boolean {
        return mExpanded
    }

    override fun setExpanded(expanded: Boolean) {
        mExpanded = expanded
    }
}

@Parcelize
data class StuAnswer(
    val StuAnswer: String
) : Parcelable